#include "MJStruct.h"
#ifdef MJPUBLIC

bool tagWeaveItem::IsUseMagicCard()
{
	uint8 ui8CardNum = ui8WeaveKind == WIK_GANG ? 4 : 3;
	for (uint8 i = 0; i < ui8CardNum; i++)
	{
		if (ui8CardData[i] != ui8CenterCard)
			return true;
	}
	return false;
}

bool tagAnalyseItem::IsUseMagicCard() 
{
	if (bMagicEye)
	{
		return true;
	}
	for (uint8 t = 0; t < 4; t++)
	{
		uint8 ui8CardNum = ui8WeaveKind[t] == WIK_GANG ? 4 : 3;
		for (uint8 i = 0; i < ui8CardNum; i++)
		{
			if (ui8WeaveKind[t] == WIK_LEFT)
			{
				if (ui8CardData[t][i] != ui8CenterCard[t] + i)
					return true;
			}
			else if (ui8CardData[t][i] != ui8CenterCard[t])
				return true;
		}
	}
	
	return false;
}

std::map<uint32, uint32> MJBaseTablePlayer::GetHandCards()
{
	return m_pMJBaseInterface->GetHandCards(pos);
}

std::vector<tagWeaveItem>& MJBaseTablePlayer::GetWeaveList()
{
	return m_pMJBaseInterface->GetWeaveList(pos);
}

std::vector<uint32> MJBaseTablePlayer::GetDiscardCardsList()
{
	return m_pMJBaseInterface->GetDiscardCardsList(pos);
}

uint8 MJBaseTablePlayer::GetAction()
{
	return m_pMJBaseInterface->GetAction(pos);
}

void MJBaseTablePlayer::SetAction(const uint8 & ui32Action)
{
	m_pMJBaseInterface->SetAction(pos, ui32Action);
}

void MJBaseTablePlayer::CleanAction()
{
	m_pMJBaseInterface->CleanAction(pos);
}

void MJBaseTablePlayer::AddCard(const uint32 card, uint32 num)
{
	m_pMJBaseInterface->AddCard(pos, card, num);
}

void MJBaseTablePlayer::RemoveCard(const uint32 card, uint32 num)
{
	m_pMJBaseInterface->RemoveCard(pos, card, num);
}

void MJBaseTablePlayer::SetCardNum(const uint32 card, uint32 num)
{
	m_pMJBaseInterface->SetCardNum(pos, card, num);
}

void MJBaseTablePlayer::AddChiPengGang(tagWeaveItem & Weave)
{
	m_pMJBaseInterface->AddChiPengGang(pos, Weave);
}

bool MJBaseTablePlayer::CheckPlayerHuPai()
{
	return m_pMJBaseInterface->CheckPlayerHuPai(pos);
}

bool MJBaseTablePlayer::CheckPlayerTingPai()
{
	return m_pMJBaseInterface->CheckPlayerTingPai(pos);
}

bool MJBaseTablePlayer::CheckPlayerChiPai(uint32 card)
{
	return m_pMJBaseInterface->CheckPlayerChiPai(pos, card);
}

bool MJBaseTablePlayer::CheckPlayerPengPai(uint32 card)
{
	return m_pMJBaseInterface->CheckPlayerPengPai(pos, card);
}

bool MJBaseTablePlayer::CheckPlayerGangPai()
{
	return m_pMJBaseInterface->CheckPlayerGangPai(pos);
}

bool MJBaseTablePlayer::CheckPlayerGangPai(uint32 card)
{
	return m_pMJBaseInterface->CheckPlayerGangPai(pos, card);
}

void MJBaseTablePlayer::SetChannelInterface(AIMaJiangChannelBaseInterface * pMJBaseInterface)
{
	m_pMJBaseInterface = pMJBaseInterface;
}



#endif // MJPULIC


